package findTheArrayConcVal;

public class Solution {
    public long findTheArrayConcVal(int[] nums) {
        long ans = 0;
        int first = 0,last = nums.length-1;
        while (first<last) {
            String a = Integer.toString(nums[first]);
            String b = Integer.toString(nums[last]);
            ans+= Long.parseLong(a+b);
            last--;
            first++;
        }
        if(last == first) {
            ans+=nums[first];
        }
        return ans;
    }
}
